using System.Collections.Generic;
using System.IO;
using Microsoft.AspNetCore.Http;

namespace Yozeev.IO.ExcelHelper
{
    /// <summary>
    /// Excel表操作的接口定义
    /// </summary>
    public interface IExcelHelper
    {
        /// <summary>
        /// 读取Excel并且返回单个实体
        /// </summary>
        /// <typeparam name="T">实体的类型</typeparam>
        /// <param name="file">abp 的IFormFile类型</param>
        /// <returns></returns>
        T Read<T>(IFormFile file);

        /// <summary>
        /// 读取Excel并且返回单个实体
        /// </summary>
        /// <typeparam name="T">实体的类型</typeparam>
        /// <param name="fileStream">文件流</param>
        /// <returns></returns>
        T Read<T>(Stream fileStream);

        /// <summary>
        /// 读取Excel并且返回单个实体
        /// </summary>
        /// <typeparam name="T">实体的类型</typeparam>
        /// <param name="filepath">文件路径</param>
        /// <returns></returns>
        T Read<T>(string filepath);

        /// <summary>
        /// 读取Excel并将结果转成实体的列表返回
        /// </summary>
        /// <typeparam name="T">实体的类型</typeparam>
        /// <param name="file">abp 的IFormFile类型</param>
        /// <returns></returns>
        List<T> ReadToList<T>(IFormFile file);

        /// <summary>
        /// 读取Excel并将结果转成实体的列表返回
        /// </summary>
        /// <typeparam name="T">实体的类型</typeparam>
        /// <param name="fileStream">文件流</param>
        /// <returns></returns>
        List<T> ReadToList<T>(Stream fileStream, string Suffix);

        /// <summary>
        /// 读取Excel并将结果转成实体的列表返回
        /// </summary>
        /// <typeparam name="T">实体的类型</typeparam>
        /// <param name="filepath">文件路径</param>
        /// <returns></returns>
        List<T> ReadToList<T>(string filepath);
    }
}
